<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html class="no-js">

	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="description" content="">
		<meta name="keywords" content="">
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
		<title>登录</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<link rel="stylesheet" href="/Public/Mobile/login/css/amazeui.min.css">
		<link rel="stylesheet" href="/Public/Mobile/login/css/app.css">
		<!--表单验证-->
		<link rel="stylesheet" href="/Public/plugin/validate/css/validate.css?v=4.1.0">
	</head>

	<body>
		<div class="am-g myapp-login">
			<div class="myapp-login-bg">
				<div class="myapp-login-logo">
					<img src="/Public/Mobile/login/img/logo.png" style="height:10em;margin-top:1em;margin-left:-1em;" />
				</div>
				<div class="am-u-sm-10 myapp-login-form">
					<form action="<?php echo U('Index/login');?>" class="am-form" method="post">
						<fieldset>
							<style>
								.myapp-login .myapp-login-bg {
									padding-top: 0 !important;
								}
								
								.myapp-login-form{
									max-width:400px;
								}
								
								.myapp-login,
								body {
									background: none !important;
								}
								
								html {
									background-image: -webkit-linear-gradient(top, #66b9b7, #8bccfd) !important;
									background-size: 100% 100%;
								}
								
								input {
									background: white !important;
									color: black !important;
									cursor:pointer;
								}
								
								input,
								button {
									outline: none !important;
								}
								
								#vcode {
									vertical-align: middle;
									border-radius: 5px;
									width: 10em;
									height: 3em;
									cursor:pointer;
								}
							</style>
							<div class="am-form-group">
								<input type="hidden" name='province' id="province" />
								<input type="hidden" name='city' id="city" />
								<input type="hidden" name='district' id="district" />

								<input type="hidden" name='jingdu' id="jingdu" />
								<input type="hidden" name='weidu' id="weidu" />

								<input name="email" reg="username" type='text' placeholder="请输入用户名">
							</div>

							<div class="am-form-group">
								<input name="password" type="password" placeholder="请输入密码">
							</div>
							<div class="am-form-group">
								<input name="repassword" type="password" check="password" placeholder="演示自动验证重复密码">
							</div>
							
							
							<div class="am-form-group" style="text-align:center">
								<img id="vcode" alt='验证码，点击更换' />
							</div>

							<div class="am-form-group">
								<input name="vcode" type="tel" class="vcode" id="vcodei" value="" placeholder="请输入图片中的验证码">
							</div>
							<p><button type="submit" class="am-btn am-btn-default">登 录</button></p>
							<div class="login-text">

							</div>
						</fieldset>
					</form>
				</div>
			</div>
		</div>

		<script src="/Public/Mobile/login/js/jquery.min.js"></script>

		<script src="/Public/Mobile/login/js/amazeui.min.js"></script>
		<script src="/Public/Mobile/login/js/app.js"></script>
		<!--表单验证-->
		<script src="/Public/Common/js/ajaxForm.js"></script>
		<script src="/Public/plugin/validate/js/validate.php"></script>
		<script src="/Public/plugin/layer/layer.js"></script>
		<script src="http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js"></script>
		<script type="text/javascript">
			$(function() {
				//获取经纬度

				if(navigator.geolocation) {
					navigator.geolocation.getCurrentPosition(function(position) {
						$('#weidu').val(position.coords.latitude);
						$('#jingdu').val(position.coords.longitude);
					});
				}

				$('#vcode').click(function() {
					$(this).attr('src', "<?php echo U('Index/vcode');?>?rand=" + Math.random());

				});
				$('#province').val(remote_ip_info['province']);
				$('#city').val(remote_ip_info['city']);
				$('#district').val(remote_ip_info['district']);
				$('form').ajaxForm({
					beforeSubmit: checkForm,
					success: complete,
					dataType: 'json'
				});

				function checkForm() {

				}

				function complete(data) {
					if(data.url == '3') {
						layer.msg(data.info);
						$('#vcodei').val('').focus();
						$('#vcode').click();
						return false;
					} else if(data.status == 1) {
						layer.msg(data.info, function(index) {
							layer.close(index);
							window.location.href = data.url;
						});
					} else {
						layer.msg(data.info);
						$('#password').val('').focus();
						$('#vcodei').val('');
						$('#vcode').click();
						return false;
					}
				}
			});
		</script>

	</body>

</html>